package com.gitee.genshin.analyse;

import cn.hutool.log.LogFactory;
import cn.hutool.log.dialect.console.ConsoleColorLogFactory;
import cn.hutool.setting.dialect.Props;
import com.gitee.genshin.analyse.data.service.AverageService;
import com.gitee.genshin.analyse.data.service.SaveService;
import com.gitee.genshin.analyse.data.service.SingleCountService;
import com.gitee.genshin.analyse.data.service.TotalCountService;

import java.util.Arrays;

/**
 * 程序启动类
 *
 * @author hongda.li.dlmu@qq.com 2022/7/12 16:14
 */
public class Main {
    /**
     * 全局配置文件
     */
    public static final Props CONFIG = Props.getProp("config.properties");

    public static void main(String[] args) {
        // 设置彩色日志工厂
        LogFactory.setCurrentLogFactory(ConsoleColorLogFactory.class);

        // 添加服务并运行
        Arrays.asList(new SaveService()
                        , new TotalCountService()
                        , new SingleCountService()
                        , new AverageService())
                .forEach(service -> {
                    service.doService();
                    System.out.println();
                    service.write("");
                });
    }
}
